package frontend;

public class ErrorInf implements Comparable<ErrorInf>{
    private int line;
    private String type;
    public ErrorInf(int line,String type) {
        this.line = line;
        this.type = type;
    }

    public int getLine() {
        return line;
    }

    public String getType() {
        return type;
    }
    @Override
    public String toString() {
        return line + " " + type;
    }

    @Override
    public int compareTo(ErrorInf o) {
        if (this.line < o.getLine()) {
            return -1;
        }
        if (this.line == o.getLine()) {
            return this.getType().charAt(0) -o.getType().charAt(0);
        }
        return 1;
    }
}
